library MyKu3;
//单继承模型的普通实现

abstract class Vehicle {}

abstract class MotorVehicle extends Vehicle {}

abstract class NonMotorVehicle extends Vehicle {}

class Motor extends MotorVehicle {
  void petrolDriven() => print("汽油驱动");

  void passengerService() => print("载人");

  void carryCargo() => ("载货");
}

class Bus extends MotorVehicle {
  void petrolDriven() => print("汽油驱动");

  void electricalDriven() => print("电能驱动");

  void passengerService() => print("载人");
}

class Truck extends MotorVehicle {
  void petrolDriven() => print("汽油驱动");

  void carryCargo() => print("载货");
}

class Bicycle extends NonMotorVehicle {
  void electricalDriven() => print("电能驱动");

  void passengerService() => print("载人");
}

class Bike extends NonMotorVehicle {
  void passengerService() => print("载人");
}
